﻿@model IRIS.Models.ContentCreateViewModel
@{
    ViewBag.Title = "Add";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


 @if (!ViewData.ModelState.IsValid)
 {
     <div class="error" >
        @Html.ValidationSummary(false)
    </div>
 }
@if (Model.m_News == true)
{
    using (Html.BeginForm())
    {
        //We are going to trust the people who have access
         <fieldset>
            <legend>Skrifa nýja frétt</legend>

            @Html.HiddenFor(m => m.m_News)
            
            <div class="editor-label text">
                    Titill
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.m_Content.ContentTitle)
                
            </div>
            
            <div class="editor-label">
                Efni
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(m => m.m_Content.ContentText)
            </div>
        
            <p>
                <input type="submit" value="Bæta við Frétt" />
            </p>
         </fieldset>
    }
}
else
{
    using (Html.BeginForm())
    {
        //We are going to trust the people who have access
    
        <fieldset>
            <legend>Skrifa nýja grein</legend>

                @Html.HiddenFor(m => m.m_News)
                
                <div class="editor-label text">
                    Titill
                </div>
                <div class="editor-field">
                   @Html.TextBoxFor(m => m.m_Content.ContentTitle)
                </div>

                <div class="editor-label">
                    Stutt lýsing
                </div>
                <div class="editor-field">
                   @Html.TextAreaFor(m => m.m_Content.Description)
                </div>

                <div class="editor-label">
                    Efni
                </div>
                <div class="editor-field">
                   @Html.TextAreaFor(m => m.m_Content.ContentText)
                </div>

                <div class="editor-label">
                    Flokkur
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(n => n.m_Content.CID, new SelectList(Model.m_Categories, "ID", "Name"))
                </div>
          
                <p>
                    <input type="submit" value="Bæta við Grein" />
                </p>
        </fieldset>
    }
}
